<template>
  <div id="root">
    <el-header style="backdrop-filter: blur(10px);">
      <blog-header :headerIndex="activeName"></blog-header>
    </el-header>
    <el-mian>
      <nuxt />
    </el-mian>
    <el-footer>
      <blog-footer />
    </el-footer>
  </div>
</template>

<script>
import { getToken } from '@/utils/auth'
import BlogHeader from '~/pages/layouts/BlogHeader.vue';
import BlogFooter from '~/pages/layouts/BlogFooter.vue';
export default {
  name: 'default',
  components: { BlogHeader, BlogFooter },
  data() {
    return {
      activeName: "articleIndex",
    }
  },
  created() {
    this.activeName = this.$route.query.key ? this.$route.query.key : 'articleIndex'
    this.initDate()
  },
  methods: {
    async initDate() {
      this.$store.dispatch("user/setToke", getToken())
      await this.$store.dispatch("user/getInfo")
    },
    // checkComponents(value) {
    //   alert("dasdasda")
    //   this.activeName = value
    //   localStorage.setItem("activeName", value)
    // },
  }
}
</script>

<style>
/* 修改滚动条的宽度、颜色和圆角 */
::-webkit-scrollbar {
  width: 8px;
}

/* 修改滚动条滑块的颜色和圆角 */
::-webkit-scrollbar-thumb {
  background-color: #898989;
  border-radius: 5px;
}

/* 修改滚动条轨道的颜色和圆角 */
::-webkit-scrollbar-track {
  background-color: #2a2c30;
}

.el-header,
.el-footer {
  padding: 0 !important;
}

.el-header {
  padding: 0;
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  box-shadow: 0px 1px 20px 0px rgba(0, 0, 30, 0.7);
}

.el-footer {
  background-color: transparent;
  color: #333;
  text-align: center;
  /* line-height: 60px; */
  padding: 0;
}


html {
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  word-spacing: 1px;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}


*,
*:before,
*:after {
  box-sizing: border-box;
  margin: 0;
}

.button--green {
  display: inline-block;
  border-radius: 4px;
  border: 1px solid #3b8070;
  color: #3b8070;
  text-decoration: none;
  padding: 10px 30px;
}

.button--green:hover {
  color: #fff;
  background-color: #3b8070;
}

.button--grey {
  display: inline-block;
  border-radius: 4px;
  border: 1px solid #35495e;
  color: #35495e;
  text-decoration: none;
  padding: 10px 30px;
  margin-left: 15px;
}

.button--grey:hover {
  color: #fff;
  background-color: #35495e;
}
</style>
